package com.example.lock;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

import lombok.extern.slf4j.Slf4j;

/**
 * <p>Description: </p>
 *
 * @author zg
 * @version v1.0.0
 * @since 2024/8/19
 **/
@Slf4j
@MapperScan("com.example.lock.mapper")
@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        //SpringApplication.run(MuseumApplication.class, args);
        log.info("Application starting......");
        ConfigurableApplicationContext configAppCont = SpringApplication.run(Application.class, args);
        ConfigurableEnvironment confEnv = configAppCont.getEnvironment();
        String appName = confEnv.getProperty("spring.application.name");
        String port = confEnv.getProperty("server.port");
        String profilesActive = confEnv.getProperty("spring.profiles.active");

        log.info("Application Service Provider[env:{}] started on port {}, appName:{}  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", profilesActive, port, appName);
    }
}
